﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using MQ.Core.Entity.System;
using MQ.Core.IService.System;
using MQ.Core.Model;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;

namespace MQ.Core.Admin.Areas.System.Controllers
{
    /// <summary>
    /// 省市区
    /// </summary>
    [Route("api/system/[controller]")]
    public class AreaController : ApiController
    {
        private readonly IAreaService areaService;
        /// <summary>
        /// 控制器
        /// </summary>
        /// <param name="areaService"></param>
        public AreaController(IAreaService areaService)
        {
            this.areaService = areaService;
        }
        /// <summary>
        /// 获取树形
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        [Route("tree")]
        public object GetTree()
        {
            var data = areaService.GetTree();
            return Success(data);
        }
        
    }
}